$(function () {
    $("#fdiv").mouseenter(function () {
        $("#cdiv").fadeIn("fast");
        document.getElementById('deng1').src = "/img/zhishidengl.png";
    });
    $("#fdiv").mouseleave(function () {
        $("#cdiv").fadeOut("fast");
    });
    $("#bofang").mouseenter(function () {
        $("#bofang").css({"color": "#58FA58"})
    });
    $("#bofang").mouseleave(function () {
        $(this).css({"cursor": "pointer"});
        $("#bofang").css({"color": "white"})
    });
    $("#tingzhi").mouseenter(function () {
        $(this).css({"cursor": "pointer"});
        $(this).css({"color": "#58FA58"})
    });
    $("#tingzhi").mouseleave(function () {

        $(this).css({"color": "white"})
    });
    $("#chongbo").mouseenter(function () {
        $(this).css({"cursor": "pointer"});
        $(this).css({"color": "#58FA58"})
    });
    $("#chongbo").mouseleave(function () {
        $(this).css({"color": "white"})
    });
    $("#zhengchang").mouseenter(function () {
        $(this).css({"cursor": "pointer"});
        $(this).children().children().css({"color": "#58FA58"})
    });
    $("#zhengchang").mouseleave(function () {
        $(this).children().children().css({"color": "white"})
    });
    $("#a1").mouseenter(function () {
        $(this).children().css({"color": "#58FA58"});
        $(this).css({"cursor": "pointer"});
    });
    $("#a1").mouseleave(function () {
        if ($(this).children().html() == $("#zhengchang").children("span").children().html()) {
            $(this).children().css({"color": "#58FA58"})
        } else {
            $(this).children().css({"color": "white"})
        }
    });
    $("#a2").mouseenter(function () {
        $(this).children().css({"color": "#58FA58"})
        $(this).css({"cursor": "pointer"});
    });
    $("#a2").mouseleave(function () {
        if ($(this).children().html() == $("#zhengchang").children("span").children().html()) {
            $(this).children().css({"color": "#58FA58"})
        } else {
            $(this).children().css({"color": "white"})
        }
    });
    $("#a3").mouseenter(function () {
        $(this).children().css({"color": "#58FA58"})
        $(this).css({"cursor": "pointer"});
    });
    $("#a3").mouseleave(function () {
        if ($(this).children().html() == $("#zhengchang").children("span").children().html()) {
            $(this).children().css({"color": "#58FA58"})
        } else {
            $(this).children().css({"color": "white"})
        }
    });
    //倍速单击事件
    $("#zhengchang").click(function () {
        if ($("#beisu").css("display") == 'none') {
            $("#beisu").css({"display": "block"});
            $("#zhengchang").children().children().css({"color": "#58FA58"});
        } else if ($("#beisu").css("display") == 'block') {
            $("#beisu").css({"display": "none"});
            $("#zhengchang").children().children().css({"color": "white"});
        }
    })
    $("#beisu").mouseleave(function () {
        $("#beisu").css({"display": "none"});
    })

    //正常配速选中事件
    $("#a1").click(function () {
        $("#h1").val($(this).val());
        $("#zhengchang").children("span").children().html($(this).children().html());
        $(this).children().css({"color": "#58FA58"});
        $("#a2").children().css({"color": "white"});
        $("#a3").children().css({"color": "white"});
        $("#beisu").css({"display": "none"});

    });
    //快速配速选中事件
    $("#a2").click(function () {
        $("#h1").val($(this).val());
        $("#zhengchang").children("span").children().html($(this).children().html());
        $(this).children().css({"color": "#58FA58"});
        $("#a1").children().css({"color": "white"});
        $("#a3").children().css({"color": "white"});
        $("#beisu").css({"display": "none"});
    });
    //急速选中事件
    $("#a3").click(function () {
        $("#h1").val($(this).val());
        $("#zhengchang").children("span").children().html($(this).children().html());
        $(this).children().css({"color": "#58FA58"});
        $("#a1").children().css({"color": "white"});
        $("#a2").children().css({"color": "white"});
        $("#beisu").css({"display": "none"});
    });


    var flag = true;
    function time() {
        if (flag) {
            $("#img1").css({"visibility": "hidden"});
            flag = false;
        } else {
            $("#img1").css({"visibility": "visible"});
            flag = true;
        }
    }
    setInterval(time,1100);

})